package i46

func translateNum(num int) int {
	if num == 0 {
		return 1
	}
	return translateNumWithoutZero(num)
}

func translateNumWithoutZero(num int) int {
	if num <= 0 {
		return 0
	}

	//one:=num%10;
	oneNum := num / 10
	two := num % 100
	twoNum := num / 100

	var result int

	if oneNum <= 0 {
		result = 1
	} else if twoNum <= 0 && two <= 25 && two >= 10 {
		result = translateNumWithoutZero(oneNum) + 1
	} else if two <= 25 && two >= 10 {
		result = translateNumWithoutZero(oneNum) + translateNumWithoutZero(twoNum)
	} else {
		result = translateNumWithoutZero(oneNum)
	}

	//fmt.Println(num,oneNum,twoNum,result)

	return result
}
